<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
{% autoescape true %}
<!--
Design by Free CSS Templates
http://www.freecsstemplates.org
Released for free under a Creative Commons Attribution 2.5 License

Name       : Scoreboard 
Description: A two-column, fixed-width design with dark color scheme.
Version    : 1.0
Released   : 20130602

-->
<html xmlns="http://www.w3.org/1999/xhtml">
{% include "pages/headTag.html" %}<body>
<div id="wrapper">
{% include "/pages/header.html" %}
  <div id="page" class="container">
    <div id="content">
      <div class="title">
        <h2>Query</h2>
      </div>


    <h4>Model Search</h4>


    <form class="pure-skin-mine pure-form-stacked pure-form" name="searchform" action="/msearch" method="post">
      <input type="hidden" name="qtype" value="product"/>

      <table>

      <tr>

      <td>

       <input type="text" id="query" name="query" size="80" value="{{base_pquery}}" />

      </td>

      <td>
      <label for="sort">Sort by</label><select id="sort" name=sort>
          {% for sort in sort_info %}
           {% if sort.0 == sort_order %}
             <option value="{{sort.0}}" selected="selected">{{sort.1}}</option>
           {% else %}
            <option value="{{sort.0}}">{{sort.1}}</option>
           {% endif %}
          {% endfor %}
        </select>

      </td></tr>

      <tr>
      <td>
       <input type="submit" class="pure-button pure-button-primary"  name="psearchsub" value="Model Search"/>
       <input type="reset" class="pure-button pure-button-primary"  name="psearchreset" value="Clear"/>
      </td><td></td><td></td></tr>

      </table>

    </form>



    {% if search_response %}
    <div>
     <h2>Model Search Results</h2>

      <p>
        {% if prev_link %}
          <a href="{{prev_link}}">Previous Results</a>
        {% else %}
          Previous Results
        {% endif %}
         |
        {% if next_link %}
          <a href="{{next_link}}">Next Results</a>
        {% else %}
          Next Results
        {% endif %}
      </p>

      <p>&nbsp;</p>
      {% if returned_count > 0 %}
      <p>
       {{first_res}} - {{last_res}} of {{number_found}} {{qtype}}s shown for query: <i>{{print_query}}</i>.
      </p>
      {% endif %}

      {% for result in search_response %}
        <p>
        <b><a href="/description?file={{result.1}}">{{result.3|safe}}</a></b><br/>
        <small><span style="color: #014C9D;"><i>Tags</i></span>: {{result.5}}<br/>
        <span style="color: #014C9D;"><i>Author</i></span>: {{result.4}}<br/></small>

          
          
        </p>
        
      {% endfor %}

      <p>
        {% if prev_link %}
          <a href="{{prev_link}}">Previous Results</a>
        {% else %}
          Previous Results
        {% endif %}
         |
        {% if next_link %}
          <a href="{{next_link}}">Next Results</a>
        {% else %}
          Next Results
        {% endif %}
      </p>

    </div>
    {%else %}
     {%if print_query %}
      <p>No results found.</p>
     {% endif %}

    {% endif %}
    </div>
    {% include "/pages/normalSidebar.html" %}
  </div>
</div>
{% include "/pages/footer.html" %}
</body>

<script type="text/javascript" language="JavaScript">
document.forms['searchform'].elements['query'].focus();
</script>
</html>

{% endautoescape %}
